package org.codeart.visitor.example01;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 水果类
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Fruit extends Product implements Acceptor {
    
    // 重量
    private double weight;

    public Fruit(String name, LocalDate produceDate, double price, double weight) {
        super(name, produceDate, price);
        this.weight = weight;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
